﻿using Echars.Common;
using Echars.Common.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Echars.Web.Ashx
{
    /// <summary>
    /// AjaxGetHouseInfo 的摘要说明
    /// </summary>
    public class AjaxGetHouseInfo : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            var zid = context.Request["zid"];
            context.Response.ContentType = "text/plain";
            context.Response.Write(GetHouseInfoJson(zid));
        }

        private string GetHouseInfoJson(string zid)
        {
            var list = EcharsBLL.Instance.GetHouseInfoList(zid);
            var json = list.T2Json();
            return json;
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}